<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h3>1.列表渲染</h3>
        <ul>
            <!-- item 为当前对象别名，index 数组下标0开始-->
            <li v-for="(item, index) in emps" :key="index">
                编号:{{index+1}},姓名:{{item.name}},工资:{{item.salary}}
            </li>
        </ul>
        <h3>2.迭代对象</h3>
        <ul>
            <!-- value是属性值，key是属性名，index索引值-->
            <li v-for="(value,key, index) in person" :key="index">
                第{{index+1}}个属性为:{{key}}:{{value}}
            </li>
        </ul>
    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                emps: [
                    { name: '马云', salary: 1000 },
                    { name: '马化腾', salary: 1200 },
                    { name: '东哥', salary: 1300 },
                ],
                person: {
                    name: '小梦',
                    age: 18
                }

            }
        })
    </script>
</body>

</html>